import { S } from '../s';
import { IPSAppCounterRef } from '../app/control/ipsapp-counter-ref';
import { IPSAppViewEngine } from '../app/view/ipsapp-view-engine';
import { IPSAppViewLogic } from '../app/view/ipsapp-view-logic';
import { IPSAppViewRef } from '../app/view/ipsapp-view-ref';
import { IPSAppViewUIAction } from '../app/view/ipsapp-view-uiaction';
import { IPSControl } from './ipscontrol';
import { IPSControlContainer } from './ipscontrol-container';
import { PSControlImpl } from './pscontrol-impl';

export class PSControlContainerImpl
  extends PSControlImpl
  implements IPSControlContainer
{
  protected psappcounterrefs: IPSAppCounterRef[];
  getPSAppCounterRefs(): IPSAppCounterRef[] | null {
    return (
      this.psappcounterrefs ||
      (this.psappcounterrefs = this.fillChildListModel(
        this.M.getPSAppCounterRefs,
        S._9d,
      ) as IPSAppCounterRef[])
    );
  }

  findPSAppCounterRef(objKey: any): IPSAppCounterRef | null {
    return this.getPSModel5(
      S._9d,
      this.getPSAppCounterRefs(),
      objKey,
    ) as IPSAppCounterRef;
  }

  protected psappviewengines: IPSAppViewEngine[];
  getPSAppViewEngines(): IPSAppViewEngine[] | null {
    return (
      this.psappviewengines ||
      (this.psappviewengines = this.fillChildListModel(
        this.M.getPSAppViewEngines,
        S._296,
      ) as IPSAppViewEngine[])
    );
  }

  findPSAppViewEngine(objKey: any): IPSAppViewEngine | null {
    return this.getPSModel5(
      S._296,
      this.getPSAppViewEngines(),
      objKey,
    ) as IPSAppViewEngine;
  }

  protected psappviewlogics: IPSAppViewLogic[];
  getPSAppViewLogics(): IPSAppViewLogic[] | null {
    return (
      this.psappviewlogics ||
      (this.psappviewlogics = this.fillChildListModel(
        this.M.getPSAppViewLogics,
        S._82,
      ) as IPSAppViewLogic[])
    );
  }

  findPSAppViewLogic(objKey: any): IPSAppViewLogic | null {
    return this.getPSModel5(
      S._82,
      this.getPSAppViewLogics(),
      objKey,
    ) as IPSAppViewLogic;
  }

  protected psappviewrefs: IPSAppViewRef[];
  getPSAppViewRefs(): IPSAppViewRef[] | null {
    return (
      this.psappviewrefs ||
      (this.psappviewrefs = this.fillChildListModel(
        this.M.getPSAppViewRefs,
        S._8d,
      ) as IPSAppViewRef[])
    );
  }

  findPSAppViewRef(objKey: any): IPSAppViewRef | null {
    return this.getPSModel5(
      S._8d,
      this.getPSAppViewRefs(),
      objKey,
    ) as IPSAppViewRef;
  }

  protected psappviewuiactions: IPSAppViewUIAction[];
  getPSAppViewUIActions(): IPSAppViewUIAction[] | null {
    return (
      this.psappviewuiactions ||
      (this.psappviewuiactions = this.fillChildListModel(
        this.M.getPSAppViewUIActions,
        S._8e,
      ) as IPSAppViewUIAction[])
    );
  }

  findPSAppViewUIAction(objKey: any): IPSAppViewUIAction | null {
    return this.getPSModel5(
      S._8e,
      this.getPSAppViewUIActions(),
      objKey,
    ) as IPSAppViewUIAction;
  }

  protected pscontrols: IPSControl[];
  getPSControls(): IPSControl[] | null {
    return (
      this.pscontrols ||
      (this.pscontrols = this.fillChildListModel(
        this.M.getPSControls,
        S._214,
      ) as IPSControl[])
    );
  }

  findPSControl(objKey: any): IPSControl | null {
    return this.getPSModel5(S._214, this.getPSControls(), objKey) as IPSControl;
  }
  get cls(): string {
    return 'PSControlContainerImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._1f) return true;
    return super.instanceof(cls);
  }
}
